<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "diy_pos".
 *
 * @property integer $id
 * @property integer $diy_id
 * @property integer $img_id
 * @property string $show_name
 * @property string $fab_name
 * @property string $mat_name
 * @property integer $item_id
 * @property integer $pos
 * @property integer $father
 * @property integer $x
 * @property integer $y
 * @property string $anchor_x
 * @property string $anchor_y
 * @property string $rotate
 * @property string $zoom
 * @property integer $mirror
 * @property integer $pay_state
 */
class DiyPos extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'diy_pos';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['diy_id', 'img_id', 'item_id', 'pos', 'father', 'x', 'y', 'mirror', 'pay_state'], 'integer'],
            [['anchor_x', 'anchor_y', 'rotate', 'zoom'], 'number'],
            [['show_name', 'fab_name', 'mat_name'], 'string', 'max' => 32],
            [['diy_id', 'pos'], 'unique', 'targetAttribute' => ['diy_id', 'pos'], 'message' => 'The combination of Diy ID and Pos has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'diy_id' => 'Diy ID',
            'img_id' => 'Img ID',
            'show_name' => 'Show Name',
            'fab_name' => 'Fab Name',
            'mat_name' => 'Mat Name',
            'item_id' => 'Item ID',
            'pos' => 'Pos',
            'father' => 'Father',
            'x' => 'X',
            'y' => 'Y',
            'anchor_x' => 'Anchor X',
            'anchor_y' => 'Anchor Y',
            'rotate' => 'Rotate',
            'zoom' => 'Zoom',
            'mirror' => 'Mirror',
            'pay_state' => 'Pay State',
        ];
    }
}
